package com.shiguiwu.springmybatis.spring.lazy;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @description: 延迟加载
 * 延迟加载和多列没有关系，任然是单例的bean
 * @author: stone
 * @date: Created by 2021/3/15 16:17
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.lazy
 */
public class LazyTests {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(LazyConfig.class);
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(applicationContext.getBean(beanDefinitionName));
            System.out.println(applicationContext.getBean(beanDefinitionName));

        }
    }
}
